/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.chl.niclun.projectwebshop.nbp.DataBase;


import edu.chl.niclun.projectwebshop.nbp.Entities.Client;
import utils.NonexistentEntityException;
import java.util.List;
import javax.persistence.EntityManager;

/**
 *Interface for the persistance layer
 */
public interface IJpaCtrl<T> {

    void create(T t);

    void destroy(Long id) throws NonexistentEntityException;

    void edit(T t) throws NonexistentEntityException, Exception;

    T findEntity(Long id);
    
    List<T> findLastAdded(int maxResults);

    List<T> findEntities();

    List<T> findEntities(int maxResults, int firstResult);

    List<T> searchGenre(String string);
    
    List<T> searchActor(String string);
    
    List<T> searchTitle(String string);
             
    EntityManager getEntityManager();

    int getEntityCount();
    
    void addClient(Client c);
    
    List<Client> getClient(String email);
}
